package com.cn.mmd.service;

import com.cn.mmd.mapper.MonthStatisticsMapper;
import com.cn.mmd.mapper.StudentEvaluateMapper;
import com.cn.mmd.mapper.WeekStatisticsMapper;
import com.cn.mmd.model.MonthStatistics;
import com.cn.mmd.model.StudentEvaluate;
import com.cn.mmd.model.WeekStatistics;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * Created by Administrator on 2017/1/4.
 */
@Service("EvaluateStatistics")
public class EvaluateStaServiceImpl implements EvaluateStaService {

    @Autowired
    private WeekStatisticsMapper weekStatisticsMapper;
    @Autowired
    private MonthStatisticsMapper monthStatisticsMapper;
    @Autowired
    private StudentEvaluateMapper studentEvaluateMapper;

    /**
     * 添加每周统计结果
     * @param weekStatistics
     * @return
     */
    public int insertWeekStatistics(WeekStatistics weekStatistics){
        return weekStatisticsMapper.insertSelective(weekStatistics);
    }

    /**
     * 查看最新周统计结果
     * @return
     */
    public List<WeekStatistics> selectNewStatistics(){
        return weekStatisticsMapper.selectNewStatistics();
    }


    /**
     * 添加月统计结果
     * @param monthStatistics
     * @return
     */
    public int insertMonthStatistics(MonthStatistics monthStatistics){
        return monthStatisticsMapper.insertSelective(monthStatistics);
    }

    /**
     * 通过被统计对象查看最新月统计结果
     * @return
     */
    public MonthStatistics selectMonthStatistics(String statisticalObject){
        return monthStatisticsMapper.selectMonthStatistics(statisticalObject);
    }


    /**
     * 通过条件查看月统计结果列表
     * @param monthStatistics
     * @return
     */
    public List<MonthStatistics> selectByCondition(MonthStatistics monthStatistics){
        return monthStatisticsMapper.selectByCondition(monthStatistics);
    }


    /**
     * 通过时间段查看学生标签评价
     * @param map
     * @return
     */
    public List<StudentEvaluate> selectStudentEvaluateByTimeQuantum(Map map){
        return studentEvaluateMapper.selectStudentEvaluateByTimeQuantum(map);
    }
}
